<?php
	function f400($sql){
		//data handle instance
		//set request
		//define format
		//set format
		//define query string
		//process time
		//process fitler
		$dataHandle = new DataHandle();
		$dataHandle->setRequest("400");

		$dataType = getValue($_GET['dataType']);
		
		if($dataType == "json"){
			$format = array(
				"Date" => "datem/d/Y g:i:s A",
			);
			$dataHandle->setFormat($format);
			$query = getSilosQuery();
			print($dataHandle->printJSON($sql, $query));
		}
		else{
			$temp = array();
			$temp['error'] = "400: Bad request";
			print(json_encode($temp));
		}

		unset($dataHandle);
	}

	function getSilosQuery(){
		$queryString = "
			select
				 name as Name,
				 value as Value,
				 date as Date,
				 description as Description
			from sys_OnLine_Data_Silos;		 
		";
		return $queryString;
	}
?>